<extend name="Public/base"/>

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>用户列表</h2>
    </div>
    <div class="clearfix">
        <div class="col-xs-10">
        </div>
        <!-- 高级搜索 -->
        <div class="search-form  col-xs-2 text-right">
            <div class="input-group">
                <!--<input type="text" name="nickname" class="search-input form-control" value="{:I('nickname')}"-->
                       <!--placeholder="请输入用户昵称或者ID">-->
                                 <!--<span class="input-group-btn">  <a class="btn btn-default" href="javascript:;" id="search" url="{:U('index')}"><i class="icon-search"></i></a></span>-->
            </div>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table with-padding">
        <table class="table table-bordered table-striped ">
            <thead>
            <tr>
                <!--<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>-->
                <th class="">状态</th>
                <th class="">uid</th>
                <th class="">用户名</th>
                <th class="">昵称</th>
                <th class="">信息</th>
                <th class="">手机</th>
                <th class="">创建时间</th>
                <th class="">发货时间</th>
                <th class="">收货时间</th>
                <th class="">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="list">
                <volist name="list" id="vo">
                    <tr>
                        <td>{$vo.status|filterDeviceStatus}</td>
                        <td>{$vo.uid}</td>
                        <td>{$vo.uid|get_username}</td>
                        <td>{$vo.uid|get_nickname}</td>
                        <td>{$vo.remark}</td>
                        <td>{$vo.mobile}</td>
                        <td>{$vo.creat_time}</td>
                        <td>{$vo.send_time}</td>
                        <td>{$vo.receive_time}</td>
                        <td>
                            <empty name="vo.send_time">
                                <a href="{:U('sendDevice',array('id'=>$vo['id']))}">发货</a>
                                <else />
                                <empty name="vo.receive_time">
                                    <span>已发货</span>
                                    <a href="{:U('receiveDevice',array('id'=>$vo['id']))}">确认对方收货</a>
                                    <else />
                                    <span>交易已完成</span>
                                </empty>
                            </empty>


                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="9" class="text-center"> aOh! 暂时还没有内容!</td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="with-padding">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav("{:U('User/index')}");
    </script>
</block>